﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YYS
{
    public class wxConfig
    {
        public string AppID { get; set; }
        public string AppSecret { get; set; }
    }
    /// <summary>
    /// 配置
    /// </summary>
    public partial class DefaultValue
    {
        public const string AppID = "wxc951eaa62e628b5b";//微信小程序
        public const string AppSecret = "2ad75d1992c8e37919048852e8b834b3";//微信小程序
        public const string AppID_WX = "wx7c055a436d4ca86d";//订阅号
        public const string AppSecret_WX = "f7cae048b50952a01f32b980a2ea8f50";//订阅号
        public const string AppID_WXCS = "wxae2391f696a4b843";//微信测试号
        public const string AppSecret_WXCS = "0ba5c71d0dc0c37fe94068cb9f08da69";//微信测试号
        public const string wxUrl = "http://yangys.icu/yys/wx/go?state=userinfo";//微信公众号主页
        //public const string wxUrl = "https://40k6300z85.oicp.vip/api/wx/go?state=userinfo";//微信公众号主页
        public const bool IsAddUser = true;
        public const string state = "bill,engineOil";//可以执行的页面
        public const bool IsMy = false;
        public const string DataBase = "YYS";
        public const string QQ_Email = "3121527784@qq.com";//QQ邮箱
        public const string QQ_SMTP = "fuzjrdstrnfkdehj";//QQ邮箱 SSL连接密码

        /// <summary>
        /// 0：正式环境；1：开发环境；2：测试环境
        /// 当前配置 = 1
        /// </summary>
        public const int EnvironmentFlag = 1;

        /// <summary>
        /// 是否本地测试
        /// </summary>
        public const bool IsTest = true;

        /// <summary>
        /// 服务是否调试模式
        /// </summary>
        public const bool IsSvcDebug = true;
        /// <summary>
        /// 是否云环境
        /// </summary>
        public const bool IsYun = true;

        /// <summary>
        /// 公共AES密钥
        /// </summary>        
        public static string EnvAESKey
        {
            get { return "kVfRiM3ATsuKxUsE"; }
        }

        /// <summary>
        /// 中国移动号段
        /// </summary>
        public const string ChinaMobile = "134,135,136,137,138,139,147,150,151,152,157,158,159,165,172,178,182,183,184,187,188,195,197,198";
        /// <summary>
        /// 中国联通号段
        /// </summary>
        public const string ChinaUnicom = "130,131,132,145,155,156,166,167,170,171,175,176,185,186,196";
        /// <summary>
        /// 中国电信号段
        /// </summary>
        public const string ChinaTelecom = "133,149,153,162,173,177,180,181,189,190,191,192,193,199";

        /// <summary>
        /// 官网域名
        /// </summary>
        public const string WWWBASE = EnvironmentFlag == 0 ? "www.kmhjt.com"
            : EnvironmentFlag == 2 ? "test.kmhjt.com"
            : (IsTest ? LocalBase : "dev.kmhjt.com");
        /// <summary>
        /// 官网基址
        /// </summary>
        public const string WWWURL = (EnvironmentFlag == 0 ? "http://" : "http://") + WWWBASE + (EnvironmentFlag == 0 ? "/hxtsvc/" : "/");
        /// <summary>
        /// 服务基址
        /// </summary>
        public const string APIURL = EnvironmentFlag == 0 ? "https://vxmini.kmhjt.com/"
            : EnvironmentFlag == 2 ? "http://test.kmhjt.com/"
            : (IsTest ? ("http://" + LocalBase + "/") : "http://dev.kmhjt.com/");

        /// <summary>
        /// TTSSERVER 服务基址
        /// </summary>
        public const string TTSURL = EnvironmentFlag == 0 ? "http://129.1.8.189/hlv/"
            : EnvironmentFlag == 2 ? "http://129.1.8.152/hlv/"
            : (IsTest ? ("http://"+LocalTTS+"/") : "http://129.1.8.151/hlv/");

        /// <summary>
        /// 本地媒体地址
        /// </summary>
        public const string LocalMediaUrl = APIURL + "media/"; //"http://" + LocalMediaIp + "/hxtsvc/media/";

        /// <summary>
        /// 外网媒体地址
        /// </summary>
        public const string NetMediaUrl = APIURL + "media/"; //"http://" + NetMediaIp + "/hxtsvc/media/";


        /// <summary>
        /// 企业号 家校互动 应用ID
        /// </summary>
        public const int Qiye_JxhdAgentId = 1;

        /// <summary>
        /// 企业号 内部办公系统 应用ID
        /// </summary>
        public const int Qiye_OAAgentId = 3;

        /// <summary>
        /// 企业号 通讯录 应用ID
        /// </summary>
        public const int Qiye_AddrBookAgentId = 2;

        /// <summary>
        /// 业务域名URL 替换key值
        /// </summary>
        public const string DomainKey = "$.DomainKey.$";

        /// <summary>
        /// 微信支付统一下单URL
        /// </summary>
        public const string unifiedorderUrl = "https://api.mch.weixin.qq.com/pay/unifiedorder";

        /// <summary>
        /// 微信支付 支付结果通知URL
        /// </summary>
        public const string unifiedorderNotifyUrl = "http://www.kmhjt.com/hxtsvc/wxpay/unifiedordernotify";

        /// <summary>
        /// 微信支付 订单查询URL
        /// </summary>
        public const string orderqueryUrl = "https://api.mch.weixin.qq.com/pay/orderquery";

        /// <summary>
        /// 微信支付 关闭订单URL
        /// </summary>
        public const string closeorderUrl = "https://api.mch.weixin.qq.com/pay/closeorder";

        #region ynupper
        /// <summary>
        /// ynupper 下单地址
        /// </summary>
        public const string upPayOrderUrl = DefaultValue.EnvironmentFlag == 0 ? "http://www.ynupper.com/mch/unifiedorder" : "http://dev.ynupper.com/mch/unifiedorder";
        /// <summary>
        /// ynupper 支付地址
        /// </summary>
        public const string upPayPayUrl = DefaultValue.EnvironmentFlag == 0 ? "http://www.ynupper.com/mch/unifiedPay" : "http://dev.ynupper.com/mch/unifiedPay";
        /// <summary>
        /// ynupper 订单查询地址
        /// </summary>
        public const string upPayQueryUrl = DefaultValue.EnvironmentFlag == 0 ? "http://www.ynupper.com/mch/orderquery" : "http://dev.ynupper.com/mch/orderquery";
        /// <summary>
        /// ynupper 支付结果通知地址
        /// </summary>
        public const string upPayNotifyUrl = DefaultValue.EnvironmentFlag == 0 ? "http://www.kmhjt.com/hxtsvc/weixin/upPayNotify"
            : DefaultValue.EnvironmentFlag == 1 ? "http://dev.kmhjt.com/weixin/upPayNotify"
            : "http://test.kmhjt.com/weixin/upPayNotify";
        /// <summary>
        /// ynupper 前端回调地址
        /// </summary>
        public const string upPayResultUrl = DefaultValue.EnvironmentFlag == 0 ? "http://www.kmhjt.com/hxtsvc/weixin/upPayResult"
            : DefaultValue.EnvironmentFlag == 1 ? "http://dev.kmhjt.com/weixin/upPayResult"
            : "http://test.kmhjt.com/weixin/upPayResult";
        #endregion

        /// <summary>
        /// 签名Key
        /// </summary>
        public const string signKey = "1gpK0355lC883Xf259d6PWZGHojDdbvQ11eF3i7YB5bx52nrwqmuJE0UM116ta22";

        /// <summary>
        /// 获取后台地址
        /// </summary>
        /// <param name="IsOuterNet"></param>
        /// <returns></returns>
        public static string getBackgroundLink(bool IsOuterNet = true)
        {
            return EnvironmentFlag == 0 ? "http://admin.kmhjt.com/hxtsvc/hjtb/"
                : WWWURL + "hjtb/";
        }

        /// <summary>
        /// 媒体保存盘符
        /// </summary>
        public const string mediaDisk = DefaultValue.EnvironmentFlag > 0 ? "D" : "E";

        /// <summary>
        /// oa cookie 名称
        /// </summary>
        public const string oaCookieName = EnvironmentFlag == 0 ? (IsSvcDebug ? "wxlogin0.test.kmhjt.com" : "wxlogin0.kmhjt.com")
            : EnvironmentFlag == 2 ? (IsSvcDebug ? "wxlogin2.test.kmhjt.com" : "wxlogin2.kmhjt.com")
            : (IsSvcDebug ? "wxlogin1.test.kmhjt.com" : "wxlogin1.kmhjt.com");

        /// <summary>
        /// 互学通默认域名
        /// </summary>
        public const string defaultDomain = EnvironmentFlag == 0 ? "www.kmhjt.com"
            : EnvironmentFlag == 2 ? "test.kmhjt.com"
            : (IsTest ? "hxt.az.com" : "dev.kmhjt.com");

        /// <summary>
        /// 微信 cookie名称
        /// </summary>       
        public static string getWxCookieName(int whatApp, string Host)
        {
            return string.Format("{0}{1}{2}.{3}", DefaultValue.EnvironmentFlag, DefaultValue.IsSvcDebug ? 1 : 0, whatApp, Host);
        }

        /// <summary>
        /// 结算系统 cookie名称
        /// </summary>       
        public static string getSettleCookieName(string Authority)
        {
            return string.Format("settle{0}{1}.{2}", DefaultValue.EnvironmentFlag, DefaultValue.IsSvcDebug ? 1 : 0, Authority);
        }

        /// <summary>
        /// 保护密码 cookie名称
        /// </summary>        
        public static string getDefpwdCookieName(int whatApp, string Host)
        {
            return string.Format("LK{0}{1}{2}.{3}", DefaultValue.EnvironmentFlag, DefaultValue.IsSvcDebug ? 1 : 0, whatApp, Host);
        }

        /// <summary>
        /// 环境名称
        /// </summary>
        public const string evName = EnvironmentFlag == 0 ? "" : EnvironmentFlag == 2 ? "Beta. " : "Develop.";
    }
    /// <summary>
    /// 服务器本地IP
    /// </summary>
    public partial class ServerIP
    {
        public const string _100 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.100" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _186 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.186" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _188 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.188" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _187 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.186" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _185 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.186" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _170 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.188" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _190 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.190" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _191 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.190" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _192 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.190" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _193 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.190" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _194 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.190" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _189 = DefaultValue.EnvironmentFlag == 0 ? "129.1.8.189" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
        public const string _99 = DefaultValue.EnvironmentFlag == 0 ? "192.168.0.99" : DefaultValue.EnvironmentFlag == 2 ? "129.1.8.152" : "129.1.8.151";
    }
}
